import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    redirect: '/index',
    component: () => import('../layout/index.vue'),
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('../views/Home/home/index.vue')
      },
      {
        path: '/loan-input',
        name: 'loan-input',
        component: () => import('../views/Home/loan-input/index.vue')
      },
      {
        path: '/input-manager',
        name: 'input-manager',
        component: () => import('../views/Home/input-manager/index.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
